package com.csdj.web.listener;

import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;

/**
 * packageName com.csdj.web.listener
 *
 * @author winver
 * @version 1.0
 * @className MyReqListener
 * @date 2024/11/28
 * @description TODO
 */

@WebListener
public class MyReqListener implements ServletRequestListener {

    @Override
    public void requestDestroyed(ServletRequestEvent sre) {
        ServletRequest request = sre.getServletRequest();
        System.out.println("请求被销毁了" +request);
    }

    @Override
    public void requestInitialized(ServletRequestEvent sre) {
        ServletRequest request = sre.getServletRequest();
        System.out.println("请求被创建了" +request);
        //调用业务层
    }
}
